package com.javasea.web.mapstruct.mapper;

import com.javasea.web.mapstruct.entity.Order;
import com.javasea.web.mapstruct.entity.OrderVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper(uses = {UserMapper.class,ProductMapper.class})
public interface OrderMapper {
    OrderMapper INSTANCE = Mappers.getMapper(OrderMapper.class);

    @Mapping(source = "user",target = "userVo")
    @Mapping(source = "productList",target = "productVoList")
    OrderVo convertToVo(Order order);
}
